package collection.generic;

public class Tester {
	public static void main(String[] args) {
		// create root
		Node<String> root = new Node<String>("i'm root", null);

		// create node lvl 1
		Node<String> child1_lvl1 = new Node<String>("child 1 1", root);
		Node<String> child2_lvl1 = new Node<String>("child 2 1", root);
		root.children.add(child1_lvl1);
		root.children.add(child2_lvl1);
		
		// create node lvl 2
		Node<String> child1_lvl2 = new Node<String>("child 1 2", child1_lvl1);
		Node<String> child2_lvl2 = new Node<String>("child 2 2", child2_lvl1);
		child1_lvl1.addChild(child1_lvl2);
		child2_lvl1.addChild(child2_lvl2);
		
		Tree<String> tree = new Tree<String>(root);

		System.out.println(tree.exist("child"));

		System.out.println(tree.exist("child 1 2"));

		System.out.println(tree.exist("i'm root"));
	}
}
